home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_09
/
2n09067a
< prev
next >
Wrap
Text File
|
1991-07-24
|
4KB
|
107 lines
// SAMPLE25.L - Demonstrate Predefined and Custom Cursors.
main
{
window ();
w.menu = new menu
<< new menuitem ("&Arrow")
<< new menuitem ("&Wait")
<< new menuitem ("&Cross")
<< new menuitem ("&Ibeam")
<< new menuitem ("Ic&on")
<< new menuitem ("Si&ze")
<< new menuitem ("Size&NESW")
<< new menuitem ("SizeN&S")
<< new menuitem ("SizeNWS&E")
<< new menuitem ("Size&WE")
<< new menuitem ("&UpArrow")
<< new menuitem ("Cur&1")
<< new menuitem ("Cur&2");
cur1 = new cursor <<
"xbbbbbb " <<
"bbbbbb " <<
"bbbbb " <<
"bbbbb " <<
"bbbbbb " <<
"bb bbb " <<
"b bbb " <<
" bbb " <<
" bbb " <<
" bbb " <<
" bbb " <<
" bbb " <<
" bbb " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb " <<
" " <<
" bbb";
cur2 = new cursor (15, 0) <<
" x " <<
" bib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib " <<
" bi ib ";
}
set_cursor (string name, any cursor)
{
cur_cursor = name;
w.cursor = cursor;
}
wait {set_cursor ("wait", "wait");}
arrow {set_cursor ("arrow", "arrow");}
cross {set_cursor ("cross", "cross");}
ibeam {set_cursor ("ibeam", "ibeam");}
icon {set_cursor ("icon", "icon");}
size {set_cursor ("size", "size");}
sizenesw {set_cursor ("sizenesw", "sizenesw");}
sizens {set_cursor ("sizens", "sizens");}
sizenwse {set_cursor ("sizenwse", "sizenwse");}
sizewe {set_cursor ("sizewe", "sizewe");}
uparrow {set_cursor ("uparrow", "uparrow");}
cur1 {set_cursor ("cur1", cur1);}
cur2 {set_cursor ("cur2", cur2);}
cur3 {set_cursor ("cur3", cur3);}
cur4 {set_cursor ("cur4", cur4);}
cur5 {set_cursor ("cur5", cur5);}
cur6 {set_cursor ("cur6", cur6);}
paint {w.roundrectangle (50, 50, w.width - 50, w.height - 50, 50, 50);}
position (x, y) {w.home; w << x+","+y+" "+cur_cursor+" ";}
click (x, y)
{
// Can't draw predefined cursors.
if (w.cursor.isa ("string"))
beep ();
else
w.cursor.draw (w, x, y);
}